package cpa.prowon.gui;

import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;

import pho.prowon.category.IndexCategory;
import cpa.prowon.gui.util.ImageUtil;

/**
 * The categorization tree label provider returns the labels and icons that
 * shall be used to display the categories for the pictures
 * @author Chris
 */
public class CategorizationTreeLabelProvider extends LabelProvider {

	/**
	 * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
	 */
	public Image getImage(Object element) {
		
		// By default, the folder icon is returned	
		return ImageUtil.getImage("icons/folder.gif");
		
	}

	/**
	 * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
	 */
	public String getText(Object element) {
		
		// Return the name of the index category
		return ((IndexCategory) element).getName();
		
	}
	
}
